#!/usr/bin/env python
import nxt.locator

def play_song(b):
	b.play_tone_and_wait(frequency, duration)

sock = nxt.locator.find_one_brick()
if sock:
	play_song(sock.connect())
	sock.close()
else:
	print 'No NXT bricks found'
